
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>yunhoo audit vouchers</title>
    </h:head>
    <h:body>
        <h:form id="stock">
            <rich:panel header="币种类型" styleClass="content-hight">
                <rich:messages globalOnly="true"/>
                <rich:toolbar itemSeparator="grid">
                    <rich:toolbarGroup >
                        <a4j:commandButton value="新增" render="payStyle,errmessage" action="#{abroadGroupCurrencyBean.add}" >
                        </a4j:commandButton>
                        <a4j:commandButton value="修改" render="payStyle,errmessage" action="#{abroadGroupCurrencyBean.update}" >
                        </a4j:commandButton>
                        <a4j:commandButton value="删除" render="payStyle,payStyleTable,errmessage" action="#{abroadGroupCurrencyBean.checkDelete}" >
                        </a4j:commandButton>
                        <a4j:commandButton value="保存" render="payStyle,payStyleTable,errmessage" action="#{abroadGroupCurrencyBean.sava}" >
                        </a4j:commandButton>
                        <a4j:commandButton value="取消" render="payStyle,errmessage" action="#{abroadGroupCurrencyBean.cancel}" >
                        </a4j:commandButton>
                    </rich:toolbarGroup>
                </rich:toolbar>

                
                <h:outputLabel id="errmessage" value="#{queryBean.err.errtip}" style="color:red"/>

                <h:panelGrid id="payStyle" columns="2">
                    <h:outputText value="代码:"/>
                    <h:inputText  disabled="#{!abroadGroupCurrencyBean.editAble}"  value="#{abroadGroupCurrencyBean.currency.code}"/>
                    <h:outputText value="名称:"/>
                    <h:inputText  disabled="#{!abroadGroupCurrencyBean.editAble}"  value="#{abroadGroupCurrencyBean.currency.name}"/>
                    <h:outputText value="符号:"/>
                    <h:inputText disabled="#{!abroadGroupCurrencyBean.editAble}" value="#{abroadGroupCurrencyBean.currency.sign}" rendered="#{abroadGroupCurrencyBean.currency.code !='ECU'}"/>
                    <h:inputText value="€"  disabled="#{!abroadGroupCurrencyBean.editAble}" rendered="#{abroadGroupCurrencyBean.currency.code =='ECU'}"/>
                </h:panelGrid>

                <rich:dataTable id="payStyleTable" value="#{abroadGroupCurrencyBean.currencyModel}" rows="10" var="group"
                                onrowmouseover="this.style.backgroundColor='#F1F1F1'"
                                onrowmouseout="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
                                rowClasses="list-row-odd,list-row-even" style=" width: 250px;" >

                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="代码"/>
                            </h:panelGroup>
                        </f:facet>
                        <a4j:commandLink action="#{abroadGroupCurrencyBean.getcurrency}" render="payStyle" >
                            <h:outputText value="#{group.code}"/>
                        </a4j:commandLink>
                    </rich:column>

                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="名称"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{group.name}"/>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="符号"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{group.sign}" rendered="#{group.code !='ECU'}"/>
                        <h:outputText value="€"  rendered="#{group.code =='ECU'}"/>
                    </rich:column>
                </rich:dataTable>
            </rich:panel>
        </h:form>
    </h:body>
</html>
